package com.community.backend.mapper;

import com.community.backend.pojo.Notice;
import com.community.backend.pojo.dto.NoticeQueryDTO;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface NoticeMapper {
    Page<Notice> pageQuery(NoticeQueryDTO noticeQueryDTO);

    void insert(Notice notice);

    void update(Notice notice);

    void deleteById(Integer noticeId);

    void updateSort(Integer noticeId, Integer sort);

    Notice NoticeDetail(Integer noticeId);

    void updateStatusByIds(List<Long> idList);

    List<Long> selectExpiredIds(LocalDateTime now, long lastMaxId, int limit);
    @Select("select * from notice where status ='已发布'")
    List<Notice> list();
}
